# 从应用层来说，可变和不可变的区别
# 字符串
"""a = "test"
new_a= a.replace("t","oo") # 将test的字符串里面的t换成oo
print(a) # ooesoo
print(new_a) # 字符串是不可变的"""
# 元组
"""q = (1,2,3)
q[0] = "132"
print(q)"""
# 整数、浮点型
"""a = 10. 
a = 11 # 变量值替换，将11赋值给了a，之前的a就不存在了
print(a)"""
#=============可变============
"""list1 = [1,2,3]
list1.append(55)
print(list1) # [1, 2, 3, 55]，基于原来的对象去改变的

dict1 = {"姓名":"lwx"}
dict1['姓名'] = "李宛潇"
print(dict1) # {"姓名":"李宛潇"}，基于原来的对象去改变的

set1 = {1,2,3}
set1.add(55)
print(set1) # {3,1,2,55}，基于原来的对象去改变的"""
# 不可变对象断言相等
a = "asd"
a1 = "asd"
"""print(id(a))
print(id(a1))"""
# print(a == a1) # True
# 断言地址值
# print(a is a1) # True

# 可变对象断言相等
list1 = [1,2,3]
print(id(list1))
list2 = [1,2,3]
"""print(list1 == list2) # True

# 断言地址值
print(list1 is list2) # False"""

list1.append(55)
print(id(list1))








